import { resultSuccess } from "mock/_util";
import { MockMethod } from "vite-plugin-mock";
import { getScore } from "./data";

function leaderWorkInfo() {
  return {
    baseInfo: "基本信息",
    classActivity: "班级活动",
    className: "高三十班",
    dailyWork: "日常巡逻",
    docLink: "http://localhost/file/demo.docx",
    educationPlan: "没计划",
    studentAmount: 40,
    groupEvaluation: "小组评价abababa",
    workPlan: "没计划",
  };
}

export default [
  {
    url: "/dev-api/leaderWork/getInfo",
    timeout: 100,
    method: "get",
    response: () => {
      return resultSuccess(leaderWorkInfo());
    },
  },
  {
    url: "/dev-api/leaderWork/getInfo/:id",
    timeout: 100,
    method: "get",
    response: () => {
      return resultSuccess(leaderWorkInfo());
    },
  },
  {
    url: "/dev-api/leaderWork/saveOrUpdate",
    timeout: 100,
    method: "post",
    response: () => {
      return resultSuccess({});
    },
  },
  {
    url: "/dev-api/leaderWork/getScore",
    timeout: 100,
    method: "get",
    response: () => {
      return resultSuccess(getScore());
    },
  },
  {
    url: "/dev-api/leaderWork/setScore",
    timeout: 100,
    method: "put",
    response: () => {
      return resultSuccess({});
    },
  },
] as MockMethod[];
